#pragma once
#include <d3d9.h>
#include <d3dx9tex.h>

class DXLightManager
{
private:
	D3DLIGHT9* lights;
	int lightnumber;
	void newlight(LPDIRECT3DDEVICE9 a_device, D3DLIGHT9 a_light,bool active);
public:
	DXLightManager();
	~DXLightManager();
	int createPointLight( LPDIRECT3DDEVICE9 a_device,//the DirectX Device 
						         D3DXVECTOR3 a_position, //Lights Position
						               float a_property, //The strength of the Lights properties
								       float a_attenuation, //The lights fall off as distance increases
								       float a_range); //The Maximum range the light will travel
	int createDirectLight(LPDIRECT3DDEVICE9 a_device, 
						         D3DXVECTOR3 a_position,
							     D3DXVECTOR3 a_direction,//The direction the light is facing
						               float a_property, 
								       float a_attenuation, 
								       float a_range);
	int createSpotLight(  LPDIRECT3DDEVICE9 a_device, 
						         D3DXVECTOR3 a_position,
								 D3DXVECTOR3 a_direction,
									   float a_degrees, //the width of the spotlight
						               float a_property, 
					 	               float a_attenuation, 
						               float a_range);
	
	void updateDiffuseRGB(int, float, float, float);
	void updateSpecularRGB(int, float, float, float);
	void updateAmbientRGB(int, float, float, float);
	void updateAttenuation012(int, float, float, float);
	void updateRange(int, float);
	void updateDegrees(int, float);
	void updateActivity(int,LPDIRECT3DDEVICE9, bool);
	void updatePosition(int, D3DXVECTOR3);
	void updateDirection(int, D3DXVECTOR3);
};